package com.pro.baoyi.api.logWarn.model.db;

import com.baomidou.mybatisplus.annotation.TableField;
import com.pro.baoyi.api.logWarn.enums.EnumSuccessFlag;
import com.pro.common.api.CommonConst;
import com.pro.common.api.model.BaseModel;
import com.pro.common.api.model.auth.IOpenConfigClass;
import com.pro.framework.javatodb.annotation.JTDTable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(description = "日志文件大小警告配置表")
@JTDTable(entityId = 120002, module = CommonConst.Modules.admin, sequences = {
//        "UNIQUE KEY uk_module_time_size (`module`, `time_size`)"
})
public class LogFileSizeWarningConfig extends BaseModel implements IOpenConfigClass {

    @Schema(description = "模块")
    private String module;

    @Schema(description = "时间大小")
    private String timeSize;

    @Schema(description = "时间单位")
    private String timeUnit;

    @Schema(description = "正常文件增量大小基准值（单位kb，如500kb）")
    private BigDecimal normalFileSizeInTime;

    @Schema(description = "状态")
    private EnumSuccessFlag status;

    @Schema(description = "上次失败时间")
    private LocalDateTime statusLastFailTime;

    @Schema(description = "上次失败文件大小")
    private BigDecimal statusLastFailFileSize;

    @Schema(description = "上次失败文件增量大小")
    private BigDecimal statusLastFailFileIncreaseSize;

    @Schema(description = "状态标识")
    private EnumSuccessFlag statusLast;

    @Schema(description = "配置")
    @TableField(exist = false)
    private List<LogFileSizeWarningConfigMultiple> logFileSizeWarningConfigMultiples;
}
